package com.xingkeduo.controller.api.activity;

import java.util.List;

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.xingkeduo.controller.base.InitController;
import com.xingkeduo.service.api.activity.StoreActivityService;
import com.xingkeduo.util.Constant;
import com.xingkeduo.util.tool.ResponseMessage;

/**
 * 
* @ClassName: StoreController
* @Description: 门店活动相关-c端接口
* @author lixin
* @date May 3, 2019 3:12:54 PM
*
 */
@RestController
@RequestMapping(Constant.API_URL_PREFIX + "/activity/store")
public class StoreController extends InitController {

	@Autowired
	StoreActivityService storeActivityService;
	/**
	 * 
	* @Title: getStoreHelpPaymentActivityList 
	* @Description: 获取门店代购活动列表 
	* @param @param storeId
	* @param @return    设定文件 
	* @return ResponseMessage    返回类型 
	* @throws 
	* @author lixin
	* @date May 6, 2019 2:16:23 PM
	 */
	@RequestMapping("/getStoreHelpPaymentActivityDetail")
	public ResponseMessage getStoreHelpPaymentActivityDetail(Long storeId) {
		if(storeId == null ) {
			return ResponseMessage.error("缺少店铺id",500);
		}
		return storeActivityService.getStoreHelpPaymentActivityList(storeId);
	}
	/**
	 * 
	* @Title: getStoreActivityDetail 
	* @Description: 查询单个门店活动明细-代购排除
	* @param @param storeActivityTemplateId
	* @param @return    设定文件 
	* @return ResponseMessage    返回类型 
	* @throws 
	* @author lixin
	* @date May 6, 2019 2:35:17 PM
	 */
	@RequestMapping("/getStoreActivityDetail")
	public ResponseMessage getStoreActivityDetail(Long storeId) {
		if(storeId == null ) {
			return ResponseMessage.error("缺少店铺id",500);
		}
		return storeActivityService.getStoreActivityDetail(storeId);
	}
	
	/**
	 * 
	* @Title: getBatchStoreActivityDetail 
	* @Description: 查询多个门店活动明细-代购排除
	* @param @param storeActivityTemplateId
	* @param @return    设定文件 
	* @return ResponseMessage    返回类型 
	* @throws 
	* @author lixin
	* @date May 6, 2019 2:35:42 PM
	 */
	@RequestMapping("/getBatchStoreActivityDetail")
	public ResponseMessage getBatchStoreActivityDetail(String storeIds) {
		if(StringUtils.isBlank(storeIds)) {
			return ResponseMessage.error("缺少店铺id",500);
		}
		return storeActivityService.getBatchStoreActivityDetail(storeIds);
	}
	/**
	 * 
	* @Title: getBatchHairdresserActivity 
	* @Description: 批量获取发型师活动标签
	* @param @param storeId
	* @param @param hairStyleIds
	* @param @return    设定文件 
	* @return ResponseMessage    返回类型 
	* @throws 
	* @author lixin
	* @date May 6, 2019 5:58:12 PM
	 */
	@RequestMapping("/getBatchHairdresserActivity")
	public ResponseMessage getBatchHairdresserActivity(Long storeId,String hairStyleIds) {
		if(storeId == null ) {
			return ResponseMessage.error("缺少店铺id",500);
		}
		if(StringUtils.isBlank(hairStyleIds)) {
			return ResponseMessage.error("缺少发型师id",500);
		}
		return storeActivityService.getBatchHairdresserActivity(storeId,hairStyleIds);
	}
	/**
	 * 
	* @Title: getHairdresserActivity 
	* @Description: 获取发型师店铺内活动详情 
	* @param @param storeId
	* @param @param hairStyleId
	* @param @return    设定文件 
	* @return ResponseMessage    返回类型 
	* @throws 
	* @author lixin
	* @date May 6, 2019 6:44:47 PM
	 */
	@RequestMapping("/getHairdresserActivity")
	public ResponseMessage getHairdresserActivity(Long storeId,Long hairStyleId) {
		if(storeId == null) {
			return ResponseMessage.error("缺少店铺id",500);
		}
		if(hairStyleId == null) {
			return ResponseMessage.error("缺少发型师id",500);
		}
		return storeActivityService.getHairdresserActivity(storeId,hairStyleId);
	}
	/**
	 * 
	* @Title: getStoreActivityDetail 
	* @Description: TODO(这里用一句话描述这个方法的作用) 
	* @param @param storeId
	* @param @return    设定文件 
	* @return ResponseMessage    返回类型 
	* @throws 
	* @author lixin
	* @date Jun 3, 2019 4:14:41 PM
	 */
	@RequestMapping("/getStoreActivitySummaryInfo")
	public ResponseMessage getStoreActivitySummaryInfo(Long storeId) {
		if(storeId == null ) {
			return ResponseMessage.error("缺少店铺id",500);
		}
		return storeActivityService.getStoreActivitySummaryInfo(storeId);
	}

	@RequestMapping("/getHairdresserActivitySummaryInfo/{storeId}")
	public ResponseMessage getHairdresserActivitySummaryInfo(@PathVariable Long storeId, @RequestBody List<Long> hairdresserIds) {
		if(storeId == null ) {
			return ResponseMessage.error("缺少店铺id",500);
		}
		return storeActivityService.getHairdresserActivitySummaryInfo(storeId,hairdresserIds);
	}
}
